<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="com.taobao.open.javabean.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>My JSP 'index.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="shortcut icon" href="favicon.ico" />
	</head>
	<script type="text/javascript">
	function judgecheck()
	{
		var s = document.getElementsByName("check");
		var j = 0;
		for ( var i = 0; i < s.length; i++)
		{   
			if(s[i].checked)
			{
				j++;
			}
		}
		if(j == 0)
		{
			alert("请选择参加活动的宝贝");
			return false;
		}else
		{
			return true;
		}
	}
	
	function getvalue(ss)
			{
				var dd = document.getElementById(ss);
				if(!dd.checked)
				{
					dd.checked = true;
				}else
				{
					dd.checked = false;
				}
			}
	function sub()
	{
		myform.submit();
	}
	</script>
	<body style="text-align: center; margin: 0" bgcolor=#eaf4fe>
		<%
			String username = (String) request.getAttribute("name");
			String taobaoR = (String) request.getAttribute("taobaoResponse");
			Trade[] trades = (Trade[]) request.getAttribute("trades");
			String TotalResults = (String) request.getAttribute("TotalResults");
		%>
		<div align="center"
			style="background-color: #465461; font-size: 20; width: 70%">
			<img alt="" src="images/test.jpg">
			欢迎您<%=username%>
		</div>
		<div style="height: 2"></div>
		<!--  -->
		<div align="center"
			style="height: 80%; width: 70%; background: #f3f3f3; padding: 0px; margin: 0px auto;">
			<div align="center"
				style="background: red; padding: 0px; margin: 0px auto;">
				<div id="home" align="center"
					style="border: 1px solid #ccc; border-right: none; border-top: none; background: #619dd7; width: 20%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					首页
				</div>
				<div id="stepone" align="center"
					style="border: 1px solid #ccc; border-right: none; border-top: none; background: f9f8f8; width: 20%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					创建新活动
				</div>
				<div id="steptwo" align="center"
					style="border: 1px solid #ccc; border-right: none; border-top: none; background: #619dd7; width: 20%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					折扣专区
				</div>
				<div id="stepthree" align="right"
					style="border: 1px solid #ccc; background: #619dd7; border-top: none;; width: 40%; height: 40; margin: 0px; padding: 0px; float: left; line-height: 40px;">
					<a href="http://www.baidu.com">帮助</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
			</div>
			<div style="height: 2"></div>
			<div>
				<img src="images/title2.jpg">
			</div>
			<div style="height: 2"></div>


			<div style="border: 1px solid #ccc;">
				<form id="myform" method="post" action="StepThree"
					onsubmit="return judgecheck()">
					<table border="0" align="center" width="800" cellspacing="0">
						<%
							for (int k = 0; k < (Integer.parseInt(TotalResults) / 4); k++) {
						%>
						<tr>
							<%
								if (taobaoR != null) {
										for (int i = 0; i < 4; i++) {
											int p = k * 4 + i;
							%>
							<td onclick="select()">
								<input type='checkbox' name='check'
									value=<%=trades[i].getNum_iid()%>>
								<div align="center">
									<img alt="" src='<%=trades[p].getPic_url()%>' width="150"
										height="150">
								</div>
								<div align="center">
									<label style="color: blue"><%=trades[p].getTitle()%></label>
								</div>
								<div align="center">
									<label><%=trades[p].getPrice()%>元
									</label>
								</div>
							</td>
							<%
								}
									} else {
									}
							%>
						</tr>
						<%
							}
						%>
					</table>
				</form>
			</div>
			<div style="height: 100">
				<input type="button" value="下一步" onclick="sub()">
			</div>
		</div>
		<!--  -->
		<div align="center" id="bottom"
			style="background-color: #eaf4fe; width: 70%; line-height: 20px;">
			<font color="#808080"> Copyright (C) 2012-2013 www.qidian.com
				All Rights Reserved 版权所有</font>
		</div>
	</body>
</html>
